package DemoMovieSystem;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Movie[] movies = new Movie[4];
        movies[0]=new Movie(1,"水门桥",38.9,9.8,"徐克","吴京","12万人想看");
        movies[1]=new Movie(2,"出拳吧",39,7.8,"唐小白","田雨","3.5万人想看");
        movies[2]=new Movie(3,"月球陨落",42,7.9,"罗兰","贝瑞","19.7万人想看");
        movies[3]=new Movie(4,"一点就到家",35,8.7,"徐宏宇","；刘昊然","10.8万人想看");
        MovieOperator operator=new MovieOperator(movies);
        Scanner sc=new Scanner(System.in);
        exit:
        while(true){
            System.out.println("====欢迎进入电影信息系统====");
            System.out.println("1:查询全部电影信息");
            System.out.println("2：根据id查询电影的具体信息");
            System.out.println("请您输入操作命令：");
            int n=sc.nextInt();
            if(n==1){
                operator.PrintMovie();
                System.out.println("是否返回： y         n");
                char q=sc.next().charAt(0);
                if(q=='Y'||q=='y')  continue exit;
                else return;
            }
            if(n==2){
                System.out.println("请输入电影的ID：");
                int id=sc.nextInt();
                operator.SearchMovieById(id);
                System.out.println("是否返回： y         n");
                char q=sc.next().charAt(0);
                if(q=='Y'||q=='y')  continue exit;
                else return;
            }
            else System.out.println("输入不规范，请重新输入！\n----------------------------");
        }
    }
}